#include <stdio.h>

/* 1990年1月1日 是星期一 */

int main()
{
    int year, month, day, week;
    int days_per_month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    char* weekdays[] = {"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
    int sum = 0;
    int i;

    scanf("%d/%d/%d", &year, &month, &day);

    sum += (year-1990) * 365;
    sum += (year-1)/4 - 1990/4;
    sum -= (year-1)/100 - 1990/100;
    sum += (year-1)/400 -1990/400;

    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
    {
        days_per_month[1] = 29;
    }
    
    for (i = 0; i < month - 1; i++)
    {
        sum += days_per_month[i];
    }

    sum += day;
    week = sum % 7;
    printf("%d年%d月%d日是%s\n", year, month, day, weekdays[week]);
    
    return 0;
}
